<template>
	<view>
		<cu-custom bgColor="bg-blue" :isBack="true">
			<block slot="content">学校详情</block>
		</cu-custom>
		<view>
			<view style="width: 100%;height: 350rpx;">
				<image style="width: 100%; height: 300rpx; filter:brightness(80%)" :src="url"></image>
			</view>
			<view style="width: 110rpx;height: 110rpx;margin: -110rpx 0rpx 0rpx 60rpx;">
				<view><image style="width: 110rpx;height: 110rpx;border-radius: 10rpx;" :src="url_a"></image></view>
			</view>
			<view class="schoolName"style="width: 100%;height: 180rpx;background-color: #FFFFFF;margin-top: -55rpx;padding: 65rpx 0rpx 10rpx 60rpx;">
				<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;">赣州师范高等专科学校</view>
				<text class="tabwords">赣州</text>
				<text class="symbols">|</text>
				<text class="tabwords">专科院校</text>
				<text class="symbols">|</text>
				<text class="tabwords">1000-2000人</text>
			</view>
		</view>
		<view class="firmlist">
			<scroll-view scroll-x class="bg-white nav text-left text-bold solid-bottom"style="margin-top: 20rpx;font-size: 30rpx;color: black;">
				<view class="cu-item" :class="0==TabCur?'text-blue cur':''" @tap="tabSelect" data-id="0">
					实训企业
				</view>
				<view class="cu-item" :class="1==TabCur?'text-blue cur':''" @tap="tabSelect" data-id="1">
					学校信息
				</view>
			</scroll-view>
			<view v-if="TabCur==0" class="cu-list menu-avatar solid-bottom bg-white">
				<view class="firm bg-white" v-for="(item,index) in 4" :key="index"  @tap="tofirmcooperat" data-target="bottomModal" :data-id="index">
					<view class="cu-item solid-bottom flex" style="width: 100%;height: 190rpx;background-color: #FFFFFF;">
						<image style="width: 100rpx;height: 100rpx;border-radius: 100%;margin: 40rpx 20rpx 40rpx 30rpx;" :src="url_b"></image>
						<view>
							<view style="font-size: 35rpx;color: black;margin: 40rpx 0rpx 10rpx 10rpx;">赣州唯宅汇科技有限公司</view>
							<view style="color: #AAAAAA;font-size: 26rpx;">
								<text style="margin-left: 10rpx;">互联网</text>
								<text style="margin-left: 5rpx;font-size: 35rpx;">/</text>
								<text style="margin: 0rpx 15rpx 5rpx 5rpx;">电子商务</text>
								<text>计算机软件</text>
							</view>
							<view style="color: #AAAAAA;font-size: 26rpx;">
								<text style="margin: 0rpx 0rpx 5rpx 10rpx;">民营</text>
								<text style="margin: 0rpx 10rpx 0rpx 10rpx;">|</text>
								<text>100-499人</text>
							</view>
						</view>
						<text class="cuIcon-right rigpic text-gray" style="float: right;margin: 80rpx 20rpx 80rpx 120rpx;font-size: 40rpx;"></text>
					</view>
				</view>
				<!-- <view class="cu-modal bottom-modal" :class="modalName=='bottomModal'?'show':''" style="border-radius: 5rpx;">
					<view class="cu-dialog">
						<view class="modal_box">
							<view class="control_box flex">
								<view class="apply_text">申请合作</view>
								<text class="cancel_text iconfont icon-guanbi" @tap="hideModal"></text>
							</view>
							<view class="imput_information">
								<view class="input_box flex">
									<text class="iconfont icon-weibiaoti562 person_box"></text>
									<text class="linkman">联系人</text>
									<input placeholder="请输入您的姓名" style="margin-left: 58rpx; text-align: left;" v-model="contacts"/>
								</view>
								<view class="input_box input_phone flex">
									<text class="iconfont icon-shoujihao person_box"></text>
									<text class="linkman">手机号</text>
									<input placeholder="请输入您的手机号" style="margin-left: 58rpx; text-align: left;" v-model="phone"/>
								</view>
								<view>
									<button class="button_apply" @tap="applay_info()">立即申请</button>
								</view>
							</view>
						</view>
					</view>
				</view> -->
			</view>
			<!-- <view class="but_box">
				<button class="btn" @tap="showModal" data-target="bottomModal">申请合作</button>
			</view> -->
		</view>
		<view></view>
	</view>
</template>

<script>
	const {
		appLogin,
		httpGet,
		httpPost
	} = require("@/utils/common.js")
	export default {
		data() {
			return {
				modalName: null,
				TabCur: 0,
				url:'http://n.sinaimg.cn/translate/249/w639h410/20190119/6NTg-hrvcwnk8408646.jpg',
				url_a:'https://www.797rs.com/data/upload/company_img/2005/21/5ec5f0a339de3w.jpg',
				url_b:'http://www.555edu.com/d/file/2018-04-03/1617f058d34fa3d52031266d389580e2.jpg',
				contacts:'',
				phone:'',
				school_name:'',
				phone:'',
				school_id:0,
				result:''
			}
		},
		onLoad(option) {
			appLogin((user_info)=>{
				console.log(user_info)
				console.log(option.school_id)
				this.school_id = option.school_id
				if(!this.school_id){
					uni.showToast({
						icon:"none",
						title:"访问错误"
					})
					return setTimeout(()=>{uni.navigateBack()},2000) 
				}
			})
		},
		methods: {
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
				console.log(this.TabCur)
				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
			},
			// showModal(e) {
			// 	this.modalName = e.currentTarget.dataset.target
			// },
			// hideModal(e) {
			// 	this.modalName = null
			// },
			tofirmcooperat(){
				uni.navigateTo({
					url:"/pages/student/firmcooperation"
				})
			},
			applay_info(){
				httpGet({
					url:'/api/company/cooperate_school',
					data:{
						school_id:this.school_id,
						contacts:this.contacts,
						phone:this.phone
					}
				}).then(res => {
					console.log(res)
					this.result == res.result
					this.modalName = null
				})
			}
		}
	}
</script>

<style>
	.nav_box{
		height: 128rpx;
		background-color: #2284ff;
		font-size: 37rpx;
		padding-top: 67rpx;
		text-align: center;
		color: #FFFFFF;
	}
	
	.firmlist{
		background-color: #FFFFFF;
		width: 100%;
		height: 100%;
	}
	.tabwords{
		color: gray;
		font-size: 28rpx;
	}
	.symbols{
		padding: 0rpx 20rpx 0rpx 20rpx;
		color: gray;
	}

	/* .modal_box{
		height: 697rpx;
	}

	.cu-modal.bottom-modal .cu-dialog{
		border-radius: 30rpx 30rpx 0 0;
	}
	
	.control_box{
		margin-top: 35rpx;
	}
	
	.apply_text{
		font-size: 31rpx;
		color: #333333;
		font-weight: bold;
		margin-left: 314rpx;
	}
	
	.cancel_text{
		font-size: 26rpx;
		color: #c6c6c6;
		margin-left: 245rpx;
		margin-top: 7rpx;
	}
	
	.imput_information{
		margin-top: 58rpx;
	}
	
	.input_box{
		width: 684rpx;
		margin: auto;
		border-style: solid;
		border-color: #e5e5e5;
		border-width: 2rpx;
		height: 105rpx;
		border-radius: 10rpx;
		padding: 33rpx 25rpx;
	}
	
	.input_phone{
		margin-top: 25rpx;
	}
	
	.person_box{
		font-size: 35rpx;
		color: #3b73f6;
		margin-top: 2rpx;
	}
	
	.linkman{
		margin-left: 15rpx;
		font-size: 30rpx;
		color: #333333;
	}
	
	.input_name{
		margin-left: 58rpx;
	}
	
	.button_apply{
		width: 688rpx;
		margin: auto;
		margin-top: 180rpx;
		background-color: #3b73f6;
		color: #FFFFFF;
		font-size: 30rpx;
		text-align: center;
		line-height: 98rpx;
		height: 98rpx;
		border-radius: 15rpx;
	}

	.but_box{
		height: 98rpx;
		width: 100%;
		background-color: #FFFFFF;
		border-top-width: 1rpx;
		border-top-color: #e6e6e6;
		line-height: 98rpx;
		position: absolute;
		bottom: 0;
		padding-top: 13rpx;
	}
	
	.btn{
		height: 70rpx;
		width: 690rpx;
		border-radius: 90rpx;
		background-color: #3b73f6;
		text-align: center;
		line-height: 70rpx;
		color: #FFFFFF;
		font-size: 30rpx;
	} */
</style>
